export const g: any = {};

g.EARTH_RADIUS_KM = 6372.795;
g.ALT_WIGGLE_LIMIT = 8.0;

g.MAP_TILE_SIZE = 256;
g.MIN_ZOOM = 1;
g.MAX_ZOOM = 19;
g.FULL_MAP_WIDTH = g.MAP_TILE_SIZE * Math.pow(2, g.MAX_ZOOM);
g.PAN_THRESHOLD = 10;

g.SELECTED_LINE_BG_COLOR_RED = 255;
g.SELECTED_LINE_BG_COLOR_GREEN = 105;
g.SELECTED_LINE_BG_COLOR_BLUE = 87;
g.SELECTED_LINE_BG_COLOR_ALPHA = 155;

g.editing = false;

g.map_source_list = [];
g.map_canvas = null;  // 地图画布组件

g.user_data = null;  // 用户数据组件
g.user_data_tree = [
    {
        label: '用户数据',
        type: 'folder',
        expanded: true,
        draggable: false,
        droppable: true,
        children: [],
    }
];
g.root_node_list = g.user_data_tree[0].children;
g.visible_tracks = new Map();
g.track_line_points_cache = new Map();
g.tracks_to_be_drawn = [];

g.photos = new Map();
g.selected_photo = null;

g.track_edit = null;  // 轨迹编辑管理组件
g.track_info = null;  // 轨迹信息展示组件
g.track_chart = null;  // 轨迹图表展示组件
g.header = null;  // 菜单栏
g.footer = null;  // 状态栏

g.new_name_suffix = 1;
